package com.alfred.springboot.globalexceptionhandle.controller;

import cn.hutool.core.util.StrUtil;
import com.alfred.springboot.globalexceptionhandle.bean.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: alfred
 * @date: 2021/7/19
 * @description: 测试接口
 */
@RestController
public class TestController {

    @GetMapping("/say")
    public Result say(String userName) {
        if (StrUtil.isEmpty(userName)) {
            throw new NullPointerException();
        }
        return Result.builder().code(1L).message("success").build();
    }

}
